<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
	<title>行政监管单位</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel="stylesheet" type="text/css" href="../../css/style.css">
	<script type="text/javascript" src="../../js/jquery-1.8.2.js"></script>
	<script type="text/javascript" src="../../js/dialog/jquery.artDialog.source.js?skin=default"></script>
	<script type="text/javascript" src="../../js/dialog/plugins/iframeTools.source.js"></script>
	<script type="text/javascript" src="../../js/jquery.ztree.all-3.5.min.js"></script>
	<script type="text/javascript" src="../../js/datepicker/WdatePicker.js"></script>
	<script type="text/javascript" src="../../js/jquery.form.js"></script>
	<script type="text/javascript" src="../../js/jquery.page.js"></script>
	<script type="text/javascript" src="../../js/base.js"></script>
	<style>
	.inputText{padding:1px;}
	</style>
</head>
<body class="app">
	<h3>行政监管单位</h3>
	<form class="search" id="search" name="search" method="post" action="xzjgdw_search.action">
		<div class="tbdiv">
		<table>
			<tr>
				<th width="100">上级单位：</th>
				<td><select name="adminUpUnit"></select></td>
				<th width="100">行政单位编号：</th>
				<td width="100"><input type="text" class="inputText" name="adminCode" value="" style="width:110px;"/></td>
				<th width="100">行政单位名称：</th>
				<td width="100"><input type="text" class="inputText" name="adminName" value="" style="width:110px;"/></td>
				<td width="100"><input type="submit" value="查询" class="inputButton"/></td>
			</tr>
		</table>
		</div>
	</form>
	<div id="list"></div>
	<div class="optionlink">
		<span id="btnAdd">【添加信息】</span>
		<span id="btnDel">【删除所选】</span>
	</div>
	<div id="view" style="width:500px;display:none;">
		<form id="saveForm" name="saveForm" action="xzjgdw_save.action" method="post">
		<input type="hidden" name="adminId" value="" />
		<input type="hidden" name="adminUnderling" value="" />
		<input type="hidden" name="adminLongitude" value="" />
		<input type="hidden" name="adminLatitude" value="" />
		<input type="hidden" name="adminFlag" value="" />
		<input type="hidden" name="adminAddDate" value="" />
		<input type="hidden" name="adminDeleteDate" value="" />
		<input type="hidden" name="adminGrade" value="" />
		<dl class="view" style="margin-top:5px;">
			<dt>行政监管单位编号：</dt>
			<dd id="lh_adminCode">
				<input type="text" class="inputText" name="adminCode" style="width:110px;" ver="empty" msg="请填写行政监管单位编号" />
			</dd>
			<dt>上级单位：</dt>
			<dd>
				<select class="inputText" name="adminUpUnit" style="width:124px;"></select>
			</dd>
			<dt>行政监管单位名称：</dt>
			<dd>
				<input type="text" class="inputText" name="adminName" style="width:110px;" ver="empty" msg="请填写行政监管单位名称" />
			</dd>
			<dt>行政监管单位地址：</dt>
			<dd>
				<input type="text" class="inputText" name="adminAddress" style="width:120px;" />
			</dd>
			<dt>联系电话：</dt>
			<dd>
				<input type="text" class="inputText" name="adminPhone" style="width:110px;" />
			</dd>
			<dt>传真号码：</dt>
			<dd>
				<input type="text" class="inputText" name="adminFax" style="width:120px;" />
			</dd>
			<dt>E-mail：</dt>
			<dd>
				<input type="text" class="inputText" name="adminEmail" style="width:110px;"/>
			</dd>
			<dt>网站：</dt>
			<dd>
				<input type="text" class="inputText" name="adminWeb" style="width:120px;" />
			</dd>
			<dt class="giant" style="height:68px;">行政监管单位简介：</dt>
			<dd class="giant" style="height:68px;">
				<textarea class="inputText" name="adminUnitIntro" style="width:365px;height:60px;"></textarea>
			</dd>
			<div class="cl"></div>
		</dl>
		</form>
	</div>
	<script type="text/javascript">
	var view = function(data){
		$('#saveForm').resetForm();
		document.saveForm.adminId.value = "";
		document.saveForm.adminUnderling.value = "";
		document.saveForm.adminLongitude.value = "";
		document.saveForm.adminLatitude.value = "";
		document.saveForm.adminFlag.value = "";
		document.saveForm.adminAddDate.value = "";
		document.saveForm.adminDeleteDate.value = "";
		document.saveForm.adminGrade.value = "";
		$.dialog({
			id:'viewdialog',
			title:'信息查看-行政监督单位',
			lock:true,
			zIndex:99,
			padding:'5px 8px 5px 5px',
			width:'100%',
			height:'100%',
			content:document.getElementById('view'),
			button:[{
				name:"保存",
				focus:true,
				callback:function(){
					$(document.saveForm).submit();
					return false;
				}
			}]
		});
		if(data!=null){
			$('#lh_adminCode').html('<label name="adminCode"></label>');
		}else{
			$('#lh_adminCode').html('<input type="text" class="inputText" name="adminCode" style="width:110px;" ver="empty" msg="请填写行政监管单位编号" />');
		}
		$(document.saveForm).json2form(data);
	}
	$(function(){
		$('select[name=adminUpUnit]').selectload('../../common/adminunit_select.action','adminCode','adminName');
		$(document.search).ajaxForm({
			beforeSubmit:function(formData){
				var param = $(formData).formParam();
				$('#list').page('param',param);
				$('#list').page('show');
				return false;
			}
		});
		//分页列表
		$('#list').page({
			url:'xzjgdw_search.action',
			config:'pageinfo,record,first,last,next,prev,jump',
			items:[{
				name:'adminId',
				type:'checkbox',
				width:13
			},{
				title:'行政监管单位编号',
				name:'adminCode'
			},{
				title:'行政监管单位名称',
				name:'adminName'
			},{
				title:'上级单位',
				name:'adminUpUnit'
			},{
				title:'详情',
				render:function(row){
					$a = $('<a href="javascript:void(0)")">【详细】</a>');
					$a.click(function(){
						view(row);
					});
					return $a;
				}
			}]
		});

		$('#btnAdd').click(function(){
			view(null);
		});
		$('#btnDel').click(function(){
			$.dialog.confirm('您确认删除所选单位吗？',function(){
				var ids = $('#list').data('checked').join(',');
				$.post('xzjgdw_del.action',{ids:ids},function(data){
					$('#list').page('show');
				});
			});
		})
		$('#saveForm').ajaxForm({
			beforeSubmit:function(form){
				var ver = $('#saveForm').validator();
				if(!ver.reg) $.dialog.alert(ver.msg);
				return ver.reg;
			},
			success:function(data){
				$('#list').page('show');
				$.dialog.list['viewdialog'].close();
			}
		});
	});
	
	</script>
</body>
</html>
